package com.imooc.ecommerce.dao;

import com.imooc.ecommerce.entity.EcommerceOrder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * <p>EcommerceOrder Dao 接口定义
 *
 * @author Yaxi.Zhang
 * @since 2022/11/16 19:18
 */
public interface EcommerceOrderDao extends PagingAndSortingRepository<EcommerceOrder, Long> {
    /**
     * <p>根据 userId 查询分页订单
     * <p>select * from t_ecommerce_order where user_id = ? order by ... desc/asc limit x offset y
     */
    Page<EcommerceOrder> findAllByUserId(Long userId, Pageable pageable);
}
